<?php
require_once 'includes/funciones.php';
conexion();  //Conexion a la base de datos
?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Instituto Arquidiocesano Cardenal Pironio</title>
<meta name="keywords" content="free templates, website templates, CSS, HTML" />
<meta name="description" content="free website template provided by templatemo.com" />
<!-- Free CSS Templates from TemplateMo.com -->
<link href="templatemo_style.css" rel="stylesheet" type="text/css" />

<link rel='stylesheet' type='text/css' href='plugins/fullcalendar/fullcalendar/fullcalendar.css' />
<script type='text/javascript' src='plugins/fullcalendar/jquery/jquery-1.5.2.min.js'></script>
<script type='text/javascript' src='plugins/fullcalendar/fullcalendar/fullcalendar.js'></script>
<link type="text/css" href="plugins/jquery_ui/css/redmond/jquery-ui-1.8.13.custom.css" rel="Stylesheet" />   
<script type="text/javascript" src="plugins/jquery_ui/js/jquery-ui-1.8.13.custom.min.js"></script> 
<script type="text/javascript"> 

   $(document).ready(function() {

    // page is now ready, initialize the calendar...

    $('#calendar').fullCalendar({
        events: [ 
                
                <?php 
                $result=mysql_query("select * from events");
                while ($reg=mysql_fetch_array($result)){             
                    echo '    
                        {
                            title  : "'.$reg['title'].'",
                            start  : "'.$reg['date'].'",
                            desc  : "'.$reg['description'].'"
                        },';    
                }        
                ?>
                ],
                
        eventClick: function(event) {        
        cadena = "<p>" + event.desc + "</p>";
		$(cadena).dialog();
        },
        height: 500
        
    })

}); 
</script>
</head>
<body>
    
    <div id="templatemo_container">
	
	
	<?php   
	 require 'header.php';  //Llamada al Header
	?> 
              
        <div id="templatemo_content">
            
            <div class="title" style="margin:10px 0px 0px 27px">Calendario Pastoral</div>
            
            <div id="calendar" width="350" height="300" style="margin:25px;">
            </div>
    
        </div>
         <?php
	require 'foot.php';
	?>
    </div>
</body>
</html>